package api

import (
	"api-gatew/basic/config"
	__ "api-gatew/basic/proto"
	"api-gatew/handler/request"
	"github.com/gin-gonic/gin"
)

func VDetail(context *gin.Context) {
	var r request.VideoDetail
	if err := context.ShouldBind(&r); err != nil {
		context.JSON(400, gin.H{
			"code": 400,
			"msg":  "异常",
			"data": err.Error(),
		})
		return
	}
	v, err := config.EwClient.EVideoDetail(config.Ctx, &__.EVideoDetailReq{
		Id: int64(r.Id),
	})
	if err != nil {
		context.JSON(400, gin.H{
			"code": 400,
			"msg":  "异常了",
			"data": false,
		})
		return
	}
	context.JSON(200, gin.H{
		"code": 200,
		"msg":  "查询成功",
		"data": v,
	})

}
